package com.code.base.info.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.info.persistence.InfoCellMapper;
import com.code.base.info.pojo.InfoCell;
import com.code.util.PrimaryKeyUtil;


@Service
public class InfoCellService {


	@Resource
	private InfoCellMapper infoCellMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public InfoCell getDataById(Long id) {
		return infoCellMapper.getDataById(id);
	}

	public List<InfoCell> getAllData() {
		return infoCellMapper.getAllData();
	}

	public int getDataCountByCondition(InfoCell entity) {
		return infoCellMapper.getDataCountByCondition(entity);
	}

	public List<InfoCell> getDataByCondition(InfoCell entity) {
		return infoCellMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(InfoCell entity) {
		return infoCellMapper.getDataCountByLikeCondition(entity);
	}

	public List<InfoCell> getDataByLikeCondition(InfoCell entity) {
		return infoCellMapper.getDataByLikeCondition(entity);
	}

	public List<InfoCell> getDataByIds(Long[] ids) {
		return infoCellMapper.getDataByIds(ids);
	}

	public void insertData(InfoCell entity) {
		insertData(entity, true);
	}

	public void insertData(InfoCell entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		infoCellMapper.insertData(entity);
	}

	public void updateData(InfoCell entity) {
		infoCellMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		infoCellMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(InfoCell entity) {
		infoCellMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		infoCellMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		infoCellMapper.deleteDataByIds(ids);
	}

}
